package com.sunwayhorizo.health.common.convertXMLFromObject;

import java.io.IOException;

/**
 *   基础类型工具类，用来验证是否是普通类型
 */
public class BaseTypeUtil
{
    private String[] baseType = null;
    private String defaulsFielsType = "String;int;long;Long;double;Double;Date";

    public boolean checkBaseType(String clazzType) throws IOException
    {
        String[] arrayOfString;
        if (this.baseType == null)
            this.baseType = this.defaulsFielsType.split(";");

        if (clazzType != null)
        {
            int lastIndex = clazzType.lastIndexOf(".");
            if (lastIndex != -1)
                clazzType = clazzType.substring(lastIndex + 1, clazzType.length());
        }

        int j = (arrayOfString = this.baseType).length;
        for (int i = 0; i < j; ++i)
        {
            String type = arrayOfString[i];
            if (clazzType.indexOf(type) != -1)
                return true;
        }

        return false;
    }
}
